#!/usr/bin/python
# -*- encoding: utf-8 -*-
'''
@File    :   2.py
@Time    :   2020/05/04 21:47:55
@Author  :   Malygos_l 
@Version :   1.0
@Contact :   751756061@qq.com
@WebSite :   www.gitee.com/malygos_l
'''
# 定义一个函数，判断一个输入的日期，是当年的第几周，周几？  将程序改写一下，能针对我们学校的校历时间进行计算（校历第1周，2月17-2月23；校历第27周，8月17-8月23；）；
# Start typing your code from here

from datetime import date,timedelta

def calendar(a,b,c):
    inputdate = date(a,b,c)
    initdate = date(inputdate.year,1,1)
    weekdaylist = ["周一","周二","周三","周四","周五","周六","周日"]
    week = (inputdate-initdate).days//7+1
    print("是{0}年的第{1}周{2}".format(a,week,weekdaylist[inputdate.weekday()]))

# 校历
def school_calendar(a,b,c):
    inputdate = date(a,b,c)
    initdate = date(inputdate.year,2,17)
    weekdaylist = ["周一","周二","周三","周四","周五","周六","周日"]
    week = (inputdate-initdate).days//7+1
    print("是{0}年的第{1}周{2}".format(a,week,weekdaylist[inputdate.weekday()]))

(a,b,c) = eval(input())
# print(a,b,c)
calendar(a,b,c)
school_calendar(a,b,c)